package gr.data.dao;

import gr.data.hbn.factory.HibernateSessionFactory;

import org.apache.log4j.Logger;
import org.hibernate.Session;
import org.hibernate.Transaction;

/**
 * Data access object (DAO) for domain model
 * 
 * @author MyEclipse Persistence Tools
 */
public class BaseHibernateDAO implements IBaseHibernateDAO {
	private static Logger logger = Logger.getLogger(BaseHibernateDAO.class);
	
	public Session getSession() {
		logger.info("[getSession()] called");
		return HibernateSessionFactory.getSession();
	}

	public Transaction beginTransaction() {
		logger.info("[beginTransaction()] called");
		return HibernateSessionFactory.getSession().beginTransaction();
	}

	public void commit(Transaction transaction) {
		logger.info("[commit(Transaction transaction)] called");
		transaction.commit();
	}

	public void rollback(Transaction transaction) {
		logger.info("[rollback(Transaction transaction)] called");
		transaction.rollback();
	}

}